#!/bin/sh
###
 # @Author: Bin
 # @Date: 2024-11-02
 # @FilePath: /lzc-factorio-server/contentdir/ofsm/init.sh
###
set -eu

OFSM_DIR="/lzcapp/var/fsm"

# 创建 factorio server manager data 目录
mkdir -p "$OFSM_DIR"
mkdir -p "/lzcapp/var/data"

if [ ! -f "$OFSM_DIR/sqlite.db" ]; then
    cp /lzcapp/pkg/content/ofsm/sqlite.default.db "$OFSM_DIR/sqlite.db"
    echo "factorio server manager default user:admin password:yKSnAsqqAdQYvfdJwxmhyUej"
fi

echo "factorio server manager init ok!"
